import axios from './base'

export default {

  /**
   * 用户注册
   * @param {object} param
   */
  register (param) {
    return axios.post('/user/register', param)
  },

  /**
   * 用户登录
   * @param {string} username
   * @param {string} password
   * @param {boolean} rememberMe
   */
  login (username, password, rememberMe = false) {
    // return axios.post('/user/login.json', { username, password, rememberMe })
    return axios.get('/login.json', { username, password, rememberMe })
  },

  /**
   * 用户退出
   */
  logout () {
    return axios.post('/user/logout')
  }

}
